

<!-- 审核状态 -->
<div class="ui-droplist-wrap" id="state_type_box" style="position: absolute; z-index: 1000; width: 118px; display: none; ">
	<div class="droplist" style="position: relative; overflow: auto; min-height: 150px; height: 150px;">
		<div class="list-item selected" data-value="-1" title="(空)">(空)</div>
		<div class="list-item" data-value="0" title="未审核">未审核</div>
		<div class="list-item" data-value="1" title="已审核">已审核</div>
	</div>
</div>

<input type="hidden" id="state_type_id" name="" value="-1">

<script type="text/javascript">
	$(document).ready(function () {

		// 点击选择审核状态
		$("#span_checked").click(function(){
			var top=$(this).offset().top;
			var left=$(this).offset().left;
			$("#state_type_box").css({"top":(top + 24)+"px","left":(left + 0)+"px"});
			$("#state_type_box").toggle();
		});
		// 审核状态赋值
		$("#state_type_box .list-item").click(function(){
			$("#state_type_name").val($(this).attr("title"));
			$("#state_type_id").val($(this).attr("data-value"));
			$(this).addClass("selected").siblings().removeClass("selected");
			$("#state_type_box").hide();
		});
	});

	//选择审核状态-选择框外点击则隐藏
    $(document).mouseup(function (e) {
      if(e.target.id!="state_type_name"){
            var con = $("#state_type_box");   // 设置目标区域
            if (!con.is(e.target) && con.has(e.target).length === 0) {
              $("#state_type_box").hide();
            }
        } 
    });
</script>